{include file = $smarty.const.APPLICATION_PATH|cat:"/application/views/header.html"}
<!--header stop-->
{include file = $smarty.const.APPLICATION_PATH|cat:"/application/views/common/headertitle.html"}
<!--header end-->
<section class="box-user">
    <img src="/images/stp1.png" width="100%" class="fl"/>
    <form method="post" target="_self"  name="entrust"  id="entrust" action="/entrust/setptow">
    <div class="purchase2">
        <input class="purchase_w2" type="text" name="business_name" value="{if $conpanyinfo neq ''}{$conpanyinfo.business_name}{/if}" placeholder="公司名称"/>
        <input class="purchase_w2" type="text" name="mobile" value="{if $conpanyinfo neq ''}{$conpanyinfo.mobile}{/if}" placeholder="手机号码"/>
        <input class="purchase_w2" type="text" name="contacts" value="{if $conpanyinfo neq ''}{$conpanyinfo.contacts}{/if}" placeholder="联系人"/>
    </div>
    <div class="purchase1">
        <input class="purchase_w3 btn_em tac" type="button" value="下一步"/>
    </div>
    </form>
</section>

{literal}
<script type="text/javascript">
    $(function(){
        $(function(){
            $('.btn_em').click(function(){
                if(nEmpty($("input[name=business_name]"),'公司名称不能为空！','公司名称太长或太短,请重新输入！','公司名称不能为数字!','公司名称填写正确！')==false||checkSubmitMobil($("input[name=mobile]"))==false||nEmpty($("input[name=contacts]"),'联系人不能为空！','联系人太长或太短,请重新输入!','联系人不能为数字!','联系人填写正确！')==false){
                    return false;
                }else {
                    document.getElementById("entrust").submit();
                }
            });
        })

        function nEmpty(obj,txt1,txt2,txt3,txt4){
            Value = obj.val();
            if(Value==''){
                alert(txt1);
                return false;
            }else if(Value.length<2||Value.length>=20){
                alert(txt2);
                return false;
            }else if(!isNaN(obj.val())){
                alert(txt3);
                return false;
            }else{
                return true;
            }
        }

        function checkSubmitMobil(obj){
            if(obj.val()==""){
                alert("手机号码不能为空！");
                return false;
            }
            if(!obj.val().match(/^(?:13\d|15\d|18\d|14\d|17\d)\d{5}(\d{3}|\*{3})$/)){
                alert("手机号码格式不正确！请重新输入！");
                return false;
            }else{
                return true;
            }
        }

        $('input[name=business_name]').blur(function(){
            nEmpty($("input[name=business_name]"),'公司名称不能为空！','公司名称太长或太短,请重新输入！','公司名称不能为数字!','公司名称填写正确！');
        });

        $("input[name=contacts]").blur(function(){
            nEmpty($("input[name=contacts]"),'联系人不能为空！','联系人太长或太短,请重新输入!','联系人不能为数字!','联系人填写正确！');
        });

        $("input[name=mobile]").blur(function(){
            checkSubmitMobil($("input[name=mobile]"));
        });
    });
</script>
{/literal}

{include file = $smarty.const.APPLICATION_PATH|cat:"/application/views/common/footerlogin.html"}

{include file = $smarty.const.APPLICATION_PATH|cat:"/application/views/footer.html"}
